﻿@model CodeStash.Models.Security.RegisterModel

@{
    ViewBag.Title = "Register";
}
@section SpecificPageHeadStuff
 {
    @Html.ScriptTag(Url.Content("~/Scripts/Controllers/Account/accountFunctions.js"))
    @Html.ScriptTag(Url.Content("~/Scripts/jquery.validate.min.js"))
    @Html.ScriptTag(Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js"))

}
@using CodeStash.ExtensionsMethods

<h2>Create a New Account</h2>
<p>
    Use the form below to create a new account. 
</p>
<p>
    Passwords are required to be a minimum of @ViewBag.PasswordLength characters in length.
</p>

@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { id = "RegisterForm" }))
{
    @Html.AntiForgeryToken("Register")
    @Html.ValidationSummary(true, 
        "Account creation was unsuccessful. Please correct the errors and try again.")
    <div>
        <fieldset>
            <legend>Account Information</legend>
            @if (ViewData["OpenID"] != null)
            {
            <div class="editor-label">
                @Html.Label("OpenID")
            </div>
            <div class="editor-label">
                @Html.Label((string)ViewBag.OpenID)
            </div>
            }
            <div class="editor-label">
                @Html.LabelFor(m => m.UserName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.UserName, new { style = "width:300px" })
                @Html.ValidationMessageFor(m => m.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email, new { style = "width:300px" })
                @Html.ValidationMessageFor(m => m.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password, new { style = "width:300px" })
                @Html.ValidationMessageFor(m => m.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.ConfirmPassword)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.ConfirmPassword, new { style = "width:300px" })
                @Html.ValidationMessageFor(m => m.ConfirmPassword)
            </div>

            <p>
                <br />
                <input id="RegisterBtn" type="submit" value="Register" />
                <br />
            </p>

        </fieldset>
    </div>
}
